console.log('The Object.getOwnPropertyDescriptor() method returns a property descriptor for an own property of a given object.')
var o, d;

o = { get foo() { return 17; } };
d = Object.getOwnPropertyDescriptor(o, 'foo');
// d is { configurable: true, enumerable: true, get: /*the getter function*/, set: undefined }
console.log(d)

o = { bar: 42 };
d = Object.getOwnPropertyDescriptor(o, 'bar');
// d is { configurable: true, enumerable: true, value: 42, writable: true }
console.log(d)

console.log('------注意:getOwnPropertyDescriptors是ES7的内容')

console.log('------The Object.getOwnPropertyNames() method 对象不可枚举的属性也可以获取, 返回的是一个数组 returns an array of all properties (enumerable or not) found directly upon a given object.')

console.log('\nlook inside get none-enumerable properties\n')

function getNoneEnumerable() {
  var target = myObject || {};
  var enum_and_nonenum = Object.getOwnPropertyNames(target);
  var enum_only = Object.keys(target);
  var nonenum_only = enum_and_nonenum.filter(function(key) {
    var indexInEnum = enum_only.indexOf(key);
    if (indexInEnum == -1) {
      // not found in enum_only keys mean the key is non-enumerable,
      // so return true so we keep this in the filter
      return true;
    } else {
      return false;
    }
  });
  
  console.log(nonenum_only);
  return nonenum_only
}

console.log('The Object.getPrototypeOf() method returns the prototype (i.e. the value of the internal [[Prototype]] property) of the specified object.')
var proto = {};
var obj = Object.create(proto);
Object.getPrototypeOf(obj) === proto; // true
